package com.baizhi.cmfzdemo.controller;

import com.baizhi.cmfzdemo.entity.CmfzAudio;
import com.baizhi.cmfzdemo.entity.CmfzCounter;
import com.baizhi.cmfzdemo.service.CmfzAudioService;
import com.baizhi.cmfzdemo.service.CmfzCounterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

/**
 * Created by 54433 on 2019/4/4.
 */
@Controller
@RequestMapping("/cmfzCounter")
public class CmfzCounterController {
    @Autowired
    private CmfzCounterService cmfzCounterService;

    //展示所有
    @RequestMapping("/queryAllCmfzCounter")
    @ResponseBody
    public Map queryAllCmfzCounter(int page,int rows){
        System.out.println(cmfzCounterService.queryAllCmfzCounter(page,rows));
        return cmfzCounterService.queryAllCmfzCounter(page,rows);
    }
    @RequestMapping("/deleteCmfzCounter")
    @ResponseBody
    public Map deleteCmfzCounter(int [] ids){
        return cmfzCounterService.deleteCmfzCounter(ids);
    }
    @RequestMapping("/insertCmfzCounter")
    @ResponseBody
    public Map insertCmfzCounter(CmfzCounter cmfzCounter){
        return cmfzCounterService.addCmfzCounter(cmfzCounter);
    }
    @RequestMapping("/updateCmfzCounter")
    @ResponseBody
    public Map updateCmfzCounter(CmfzCounter cmfzCounter){
        return cmfzCounterService.updateCmfzCounter(cmfzCounter);
    }
}
